import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
    isflag: true,
    component: () => import('../views/login/Login.vue')
  },
  {
    path: '/login',
    name: 'login',
    isflag: true,
    component: () => import('../views/login/Login.vue')
  },
  {
    path: '/home',
    name: '学生信息',
    iconCLass: 'el-icon-s-custom',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/home/studentlist',
        name: '学生列表',
        iconCLass: 'el-icon-user-solid',
        component: () => import('@/views/studens/StudentList.vue')
      },
      {
        path: '/home/infolist',
        name: '信息列表',
        iconCLass: 'el-icon-user-solid',
        component: () => import('@/views/studens/InfoList.vue')
      },
      {
        path: '/home/worklist',
        name: '作业列表',
        iconCLass: 'el-icon-s-order',
        component: () => import('@/views/studens/WorkList.vue')
      },
      {
        path: '/home/workment',
        name: '作业管理',
        iconCLass: 'el-icon-s-order',
        component: () => import('@/views/studens/WorkMent.vue')
      },
    ],
  },
  {
    path: '/map',
    name: 'echarts地图',
    iconCLass: 'el-icon-map-location',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/map/mapdata',
        name: 'echarts地图',
        iconCLass: 'el-icon-map-location',
        component: () => import('@/views/mapData/map.vue')
      }
    ]
  },
  {
    path: '*',
    name: 'notfound',
    isflag: true,
    component: () => import('../components/notFound.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
